package com.tianji.learning.controller;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.query.QuestionAdminPageQuery;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.QuestionAdminVO;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionQuestionService;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/replies")
@Api(tags = "管理端评论相关接口")
@RequiredArgsConstructor
public class InteractionReplyAdminController {

    private final IInteractionReplyService interactionReplyService;

    /**
     * 管理端用户评论分页查询
     * @param query
     * @return
     */
    @GetMapping("/page")
    @ApiOperation(value = "管理端用户评论分页查询")
    public PageDTO<ReplyVO> adminReplyQueryPage(ReplyPageQuery query){
        return interactionReplyService.adminReplyQueryPage(query);
    }

    /**
     * 管理端修改评论状态 是否隐藏
     * @param id
     * @param hidden
     */
    @PutMapping("/{id}/hidden/{hidden}")
    @ApiOperation(value = "管理端修改评论状态 是否隐藏")
    public void adminUpdateReplyHidden(@PathVariable(value = "id")Long id,
                                       @PathVariable(value = "hidden")Boolean hidden){
        interactionReplyService.adminUpdateReplyHidden(id,hidden);
    }
}
